var contextCount=(function(){
    var _initEvent=function (that) {
        that.input.on('keyup',function () {
            that.render();
        })
    };
    var _getNum=function (that) {
        return that.input.val().length;
    };
    var contextFun=function () {

    };
    contextFun.prototype.init=function (config) {
        this.input=$(config.id);
        _initEvent(this);
        this.render();
    };
    contextFun.prototype.render=function () {
        var $text=$('#text'),num=_getNum(this);
        if($text.length===0){
            $text=$('<span id="text"></span>')
        }
        $text.html(num);
        this.input.after($text);
    };
    return contextFun;
})();
$(function () {
    new contextCount().init({id:'#app'});
});
